{% extends "website/layout.html" %}

{% block title %}{{ page.title }}{{ config.head_title }}{% endblock %}
{% block description %}{{ config.head_description }}{% endblock %}

{% block head %}
    <meta name="keywords" content="{{ config.head_keywords }}">
    <meta name="HandheldFriendly" content="true">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="shortcut icon" href="http://cdn.zitiao.org/favicon.ico" type="image/x-icon">
    
    <link rel="stylesheet" href="{{ 'assets/website/page_custom.min.css'|resolveFile }}">
    <script type="text/javascript" src="http://cdn.zitiao.org/www-tongji.js"></script>
    {% if page.next and page.next.path %}
    <link rel="next" href="{{ page.next.path|resolveFile }}" />
    {% endif %}
    {% if page.previous and page.previous.path %}
    <link rel="prev" href="{{ page.previous.path|resolveFile }}" />
    {% endif %}
{% endblock %}

{% block body %}
<div class="gb-page-wrapper">
    <header class="gb-page-header">
        <div class="container">
        {% block header %}
            <!-- search_input -->
            <div id="book-search-input" role="search">
                <input type="text" placeholder="{{ 'SEARCH_PLACEHOLDER'|t }}" />
            </div>
            <!-- search_input -->

            {% if config.logo %}
            <a href="{{ "/"|resolveFile }}" class="logo">
                <!-- <img src="{{ config.logo|resolveFile }}"> -->
                <img src="http://cdn.zitiao.org/logo.png"/>
            </a>
            {% endif %}
            <a href="{{ "/"|resolveFile }}" class="logo">
                <h1>{{ config.title }}</h1>
            </a>
        {% endblock %}
        </div>
    </header>

    <div class="gb-page-body">
        <div class="gb-page-inner">
            <div class="container">
                <div class="row">
                    <div class="col-md-3">
                        {% include "website/sidenav.html" %}
                    </div>
                    <div class="col-md-9">
                        <!-- search_result -->
                        <div id="book-search-results">
                            <div class="search-noresults">
                                
                                <!-- page -->
                                {% block page %}
                                <div class="gb-markdown book-page-inner page-inner">
                                    {{ page.content|safe }}
                                </div>
                                {% endblock %}
                                <!-- page -->

                            </div>
                            <div class="search-results">
                                <div class="has-results">
                                    {% block search_has_results %}
                                    <h1 class="search-results-title">{{ 'SEARCH_RESULTS_TITLE'|t|safe }}</h1>
                                    <ul class="search-results-list"></ul>
                                    {% endblock %}
                                </div>
                                <div class="no-results">
                                    {% block search_no_results %}
                                    <h1 class="search-results-title">{{ 'SEARCH_NO_RESULTS_TITLE'|t|safe }}</h1>
                                    {% endblock %}
                                </div>
                            </div>
                        </div>
                        <!-- search_result -->
                    </div>
                </div>
            </div>
        </div>
    </div>

    <footer class="gb-page-footer">
        <div class="container footer-container">
            <div class="copyright">
                © 2017 <a href="http://zitiao.org">字条网 zitiao.org</a> | 京ICP备16051867号-2
            </div>
        </div>
    </footer>
</div>

<script src="{{ "gitbook.js"|resolveAsset }}"></script>
{% for resource in plugins.resources.js %}
    {% if resource.url %}
    <script src="{{ resource.url }}"></script>
    {% else %}
    <script src="{{ resource.path|resolveAsset }}"></script>
    {% endif %}
{% endfor %}

<script>
    var gitbook = gitbook || [];
    gitbook.push(function() {
        gitbook.page.hasChanged({{ template.getJSContext()|dump|safe }});
    });
</script>
<script>
    $('.book-page-inner h1,.book-page-inner h2,.book-page-inner h3,.book-page-inner h4,.book-page-inner h5,.book-page-inner h6').click(function(){
        var id = $(this).attr('id');
        if(id) {
            window.location.hash=id;
        }
    });
</script>
{% endblock %}
